@iota/transaction
Utilities and validators for transactions.
Installation
Install using npm:
npm install @iota/transaction
or using yarn:
yarn add @iota/transaction
API Reference
transaction~transactionHash(trits)
Param | Type | Description |
---|
trits | Int8Array | Int8Array of 8019 transaction trits |
Calculates the transaction hash out of 8019 transaction trits.
Returns: Hash
- Transaction hash
transaction~isTransaction(tx)
Checks if input is valid transaction object.
transaction~isTailTransaction(transaction)
Param | Type |
---|
transaction | object |
Checks if given transaction object is tail transaction.
A tail transaction is one with currentIndex=0
.
transaction~isTransactionHash(hash, mwm)
Param | Type |
---|
hash | string |
mwm | number |
Checks if input is correct transaction hash (81 trytes)
transaction~isTransactionTrytes(trytes, minWeightMagnitude)
Param | Type |
---|
trytes | string |
minWeightMagnitude | number |
Checks if input is correct transaction trytes (2673 trytes)
transaction~isAttachedTrytes(trytes)
Checks if input is valid attached transaction trytes.
For attached transactions last 241 trytes are non-zero.